package org.webrx;

public class Op5Demo {
    public static void main(String[] args) {

        //1010
        System.out.println(Integer.toBinaryString(10));

        // -11
        //0000 1010
        //1111 0101  11111111 11111111 11111111 11110101  -11
        //           00000000 00000000 00000000 00001011   11
        System.out.println(0b11111111111111111111111111110101);//-11
        System.out.println(0b00000000000000000000000000001011);//11
        System.out.println(0b00000000000000000000000000001010);//10
        System.out.println(~10);//-11
        System.out.println(Integer.toBinaryString(-11));

        System.out.println(Integer.toBinaryString(11));

        //16 - 10
        System.out.println(Integer.toHexString(255)); //ff

        System.out.println(0xff);
        System.out.println(Integer.valueOf("ff",16));

        //2 - 10
        System.out.println(Integer.toBinaryString(8));
        System.out.println(0b1000);
        System.out.println(Integer.valueOf("1000",2));

        //8 - 10
        System.out.println(Integer.toOctalString(9));
        System.out.println(011);
        System.out.println(Integer.valueOf("11",8));



        System.exit(0);

        //2 输出10进制 10
        System.out.println(0b00001010);

        //8 输出10进制9
        System.out.println(011);

        //16 0 - f(15) 11 17  输出的10进制 17
        System.out.println(0x11);

        // 0010 2
        // 0011 3
        // 0010 2
        System.out.println(2 & 3);
        System.out.println(2 | 3);

        // 0010 >> 1   0001
        System.out.println(2 >> 1);
        // 0010 >> 1   0001 << 3   00001000
        System.out.println(2 >> 1 << 3);
        System.out.println(0b1000);
    }
}
